package com.google.android.gcm.demo.app;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class AlarmReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		int reqCode = intent.getIntExtra("reqCode", 0);
		int kind = intent.getIntExtra("kind", -1);
		String time = intent.getStringExtra("time");
		String imageUri = intent.getStringExtra("image_uri");
		String name = intent.getStringExtra("name");
		
		switch(kind){		
		case 1: //medication
			String medicationName = intent.getStringExtra("medication_name");						
			break;
		case 2://diagnose
			String diagnoseName = intent.getStringExtra("diagnose_name");
			break;
		case 3://healing talk
			String talk = intent.getStringExtra("talk");
			break;
		case 4:// profile
			break;
		case 5: // scrap
			int scrId = intent.getIntExtra("scr_id", -1);
			break;
		case 6: // family to patient
			String message = intent.getStringExtra("message");
			break;
		case 7: // diary
			break;
		}
		 Intent DialogIntent = new Intent(context, ActivityDialog.class);
	        DialogIntent.putExtras(intent.getExtras());
	        DialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
	        										Intent.FLAG_ACTIVITY_CLEAR_TOP |
	        										Intent.FLAG_ACTIVITY_SINGLE_TOP);
	        context.startActivity(DialogIntent);
	}

}
